﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Expressions;
using System.Data.Objects;

namespace FanPages.Common.DataAccess
{
    public interface IRepository<Entity> where Entity : class
    {
        IQueryable<Entity> AsQueryable();
        IEnumerable<Entity> Find(Expression<Func<Entity, bool>> where);
        IEnumerable<Entity> GetAll();
        Entity Single(Expression<Func<Entity, bool>> where);
        Entity First(Expression<Func<Entity, bool>> where);

        void Delete(Entity entity);
        void Add(Entity entity);
        void Attach(Entity entity);
        void Update(Entity entit);
        ObjectContext Context { get; }
    }
}

